package com.heima.utils;

/**
 * @author chenshan
 */
public class UserThreadLocal {
    private static final ThreadLocal<Integer> userThreadLocal = new ThreadLocal<>();

    /**
     * 绑定数据
     */
    public static void set(Integer id) {
        userThreadLocal.set(id);
    }

    /**
     * 获取数据
     */
    public static Integer get() {
        return userThreadLocal.get();
    }

    /**
     * 移除数据
     */
    public static void remove() {
        userThreadLocal.remove();
    }
}
